import request from '@/utils/request'

// 新增策略
export const getStrategy = (data) => {
  return request({
    url: '/api/vm-service/policy',
    method: 'post',
    data
  })
}

// 策略搜索
export const searchStrategy = (params) => {
  return request({
    url: '/api/vm-service/policy/search',
    method: 'get',
    params
  })
}

// 删除策略
export const delStrategy = (data, policyId) => {
  return request({
    url: `/api/vm-service/policy/${policyId}`,
    method: 'delete',
    data
  })
}

// 根据策略搜索售货机
export const strategyInfo = (params, policyId) => {
  return request({
    url: `/api/vm-service/policy/vmList/${policyId}`,
    method: 'get',
    params
  })
}
// 修改策略
export const editStrategy = (data, policyId) => {
  return request({
    url: `/api/vm-service/policy/${policyId}`,
    method: 'put',
    data
  })
}
